using ApiDemo.Domain.Entity;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using ApiDemo.Infrastructure.Persistence.Configuration.Base;

namespace ApiDemo.Infrastructure.Persistence.Configuration
{
    public class BlogCommentConfiguration : BaseEntityConfiguration<BlogComment>
    {
        public override void Configure(EntityTypeBuilder<BlogComment> builder)
        {
            base.Configure(builder);

            //设置表名
            builder.ToTable("blog_comment");

            builder.Property(x=>x.CommentContent).HasColumnName("blog_content").HasMaxLength(2000).HasColumnOrder(1);
        }
    }
}